package com.kiell.gulimall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kiell.common.utils.PageUtils;
import com.kiell.gulimall.product.entity.CategoryEntity;
import com.kiell.gulimall.product.vo.Catelog2Vo;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author kiell
 * @email kiell@gmail.com
 * @date 2023-05-24 16:16:13
 */
public interface CategoryService extends IService<CategoryEntity> {

    PageUtils queryPage(Map<String, Object> params);

    List<CategoryEntity> listWithTree(Map<String, Object> params);

    /**
     * 批量删除菜单
     * @param list
     * @return
     */
    int removeMenuByIds(List<Long> list);

    /**
     * 找到id完整路径
     * [父/子/孙]
     * @param catelogId
     * @return
     */
    Long[] findCatelogPath(Long catelogId);

    void updateCascade(CategoryEntity category);

    List<CategoryEntity> getLevel1Categorys();

    Map<String, List<Catelog2Vo>> getCatelogJsonFromDb();
    Map<String, List<Catelog2Vo>> getCatelogJson();

    Map<String, List<Catelog2Vo>> getCatalogJsonFromDbWithRedissonLock();

    Map<String, List<Catelog2Vo>> getCatelogJsonFromDbWithRedisLock();
}

